<?php
// +----------------------------------------------------------------------
// | OneThink [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2013 http://www.onethink.cn All rights reserved.
// +----------------------------------------------------------------------
// | Author: 麦当苗儿 <zuojiazi@vip.qq.com> <http://www.zjzit.cn>
// +----------------------------------------------------------------------

namespace Ttc\Model;
use Think\Model;

/**
 * 投诉模型
 */

class ComplaintModel extends Model {

    protected $_validate = array(
        // array('goods_storage','is_emptyStorage','请输入正确的库存',1,'function'),//库存不为0
        array('content','','请输入投诉内容',1,'notequal'),//商品价格不为空

    );

    /**
     * 添加投诉
     */
    public function addComplaint($data){

        $res = $this->create($data);

        if(!$res){
            // var_dump($this->getError());
            $res = array();
            $res['info'] = $this->getError();
            $res['msg'] = false;
            return $res;
        }
        $data['add_time'] = $data['up_time'] = time();
        // var_dump($data);exit;

        // var_dump($this->data);
        $res = $this->add($data);
        return $res;

    }
    

}
